<?php
namespace Tbf\Bundle\PackageBundle\ClassGenerator;
use CG\Generator\PhpProperty as BasePhpProperty;
use Tbf\Bundle\PackageBundle\Annotation\Annotation;
use Tbf\Bundle\PackageBundle\Annotation\AnnotationCollection;

class PhpProperty extends BasePhpProperty
{
    protected $annotation_list;
    public function __construct($name=null)
    {
        $this->annotation_list = new AnnotationCollection();
        parent::__construct($name);
    }
    public function addAnnotation(Annotation $annotation)
    {
        $this->annotation_list->addAnnotation($annotation);

        return $this;
    }
    public function setAnnotationList(AnnotationCollection $annotation_list)
    {
        $this->annotation_list = $annotation_list;

        return $this;
    }
    public function getDocblock()
    {
        return $this->annotation_list->getDocblock();
    }

    /**
     * @return PhpProperty
     */
    public static function create($name=null)
    {
        return new static($name);
    }
}
